%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Reproducing Table 5 of the paper:
%Reis, Ricardo (2006) "Inattentive Producers," Review of Economic Studies.
%Written by: Ricardo Reis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clc
clear

%Set parameters
disp('Note: This should take a few minutes to run')
disp(' ')
disp('Reading parameters')
iterations=10000;
alpha=0.11;
lambda=1/4; 
upper=100;

%Obtain MA representations for g_m and g_a
InPro_Table5b

%Results for standard specification
disp('Drawing 10,000 posibilities')
InPro_Table5a
save InPro_Table5_part1 Model Data Model05 Model95 Measur iterations legend

%Last column
disp('3-quarter plans')
clear
iterations=10000;
alpha=0.11;
lambda=1/3; 
upper=100;
InPro_Table5b
InPro_Table5a
ThreeQuarter=Model;
save InPro_Table5_part2 ThreeQuarter

%Report them all
clear
disp(' ')
disp('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$')
disp('$$$$$$$$$$$$$$$$$$$$$$$$$$$$ TABLE 5 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$')
disp('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$')
load InPro_Table5_part1
load InPro_Table5_part2
legend;
Table5=[Data; Model; Model05; Model95; Measur; ThreeQuarter]'